package com.sky.mapper;

import com.sky.dto.OrdersDTO;
import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OrderDetailMapper {

    /**
    * 批量插入订单明细数据
    * @param detailList
    * @return void
    */
    void insertBatch(List<OrderDetail> detailList);

    /**
    * 查看订单详情
    * @param orderId
    * @return List<OrderDetail>
    */
    @Select("select * from order_detail where order_id = #{orderId}")
    List<OrderDetail> getByOrderId(Long orderId);

    /**
    * 动态查询订单
    * @param ordersDTO
    * @return List<OrderDetail>
    */
    List<OrderDetail> select(OrdersDTO ordersDTO);
}
